Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since Rails uses autoloading, there is no need to explicitly require
active_support/tagged_logging
, and doing so actively prevents using an alternative.I have created a suite of gems that replace the Rails logger. They extract the logging tooling from Rails 8, add in some refactoring and fixes that allow broadcasting, tagged logging, and blocks, to all work together, (which bugs have always been present in tagged logging, and remain in v8.0, see Rails PR 53093 and Rails PR 53105).
It works with Rails because of the autoloading. If a namespace / constant is already defined, it won't go looking for it. So by defining it in my extracted gems, the vanilla (broken) Rails version doesn't load.
At that point the only problem comes from libraries which load certain Rails internals explicitly.
The suite of gems I'm aiming to have compatibility with is: